package com.edu.admin.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


/**
 * 资源配置 
 * 与WebSecurityConfig 配合使用
 * 
 * @author Wangjiong
 */
@Configuration
public class ResourcesConfig implements WebMvcConfigurer
{
	@Value("${web.htmlpath:c:/html/}")
    private String htmlPath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry)
    {
    	
    	/** 本地文件路径 */
        //registry.addResourceHandler("/html/**").addResourceLocations("file:" + htmlPath + "/");
        

        /** apidoc配置 */
        registry.addResourceHandler("/apidoc/**").addResourceLocations("classpath:/apidoc/");
        
        /** vue页面配置 */
        registry.addResourceHandler("/html/**").addResourceLocations("classpath:/html/");
    }


}